/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "sctstbtesis")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sctstbtesis.findAll", query = "SELECT s FROM Sctstbtesis s"),
    @NamedQuery(name = "Sctstbtesis.findBySctstbtesisid", query = "SELECT s FROM Sctstbtesis s WHERE s.sctstbtesisid = :sctstbtesisid"),
    @NamedQuery(name = "Sctstbtesis.findByTitulo", query = "SELECT s FROM Sctstbtesis s WHERE s.titulo = :titulo"),
    @NamedQuery(name = "Sctstbtesis.findByAutores", query = "SELECT s FROM Sctstbtesis s WHERE s.autores = :autores"),
    @NamedQuery(name = "Sctstbtesis.findByFechagrado", query = "SELECT s FROM Sctstbtesis s WHERE s.fechagrado = :fechagrado"),
    @NamedQuery(name = "Sctstbtesis.findByPalabrasclave", query = "SELECT s FROM Sctstbtesis s WHERE s.palabrasclave = :palabrasclave"),
    @NamedQuery(name = "Sctstbtesis.findByResumen", query = "SELECT s FROM Sctstbtesis s WHERE s.resumen = :resumen"),
    @NamedQuery(name = "Sctstbtesis.findByCodificacion", query = "SELECT s FROM Sctstbtesis s WHERE s.codificacion = :codificacion"),
    @NamedQuery(name = "Sctstbtesis.findByNombrearchivo", query = "SELECT s FROM Sctstbtesis s WHERE s.nombrearchivo = :nombrearchivo"),
    @NamedQuery(name = "Sctstbtesis.findByFecharegistro", query = "SELECT s FROM Sctstbtesis s WHERE s.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Sctstbtesis.findByObservaciones", query = "SELECT s FROM Sctstbtesis s WHERE s.observaciones = :observaciones"),
    @NamedQuery(name = "Sctstbtesis.findBySummary", query = "SELECT s FROM Sctstbtesis s WHERE s.summary = :summary")})
public class Sctstbtesis implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "sctstbtesisid")
    private Integer sctstbtesisid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "titulo")
    private String titulo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 150)
    @Column(name = "autores")
    private String autores;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fechagrado")
    @Temporal(TemporalType.DATE)
    private Date fechagrado;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 150)
    @Column(name = "palabrasclave")
    private String palabrasclave;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 400)
    @Column(name = "resumen")
    private String resumen;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 150)
    @Column(name = "codificacion")
    private String codificacion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 150)
    @Column(name = "nombrearchivo")
    private String nombrearchivo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 400)
    @Column(name = "summary")
    private String summary;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sctstbtesisid")
    private Collection<Sctstbparticip> sctstbparticipCollection;
    @JoinColumn(name = "scthtbnivacadeid", referencedColumnName = "scthtbnivacadeid")
    @ManyToOne
    private Scthtbnivacade scthtbnivacadeid;
    @JoinColumn(name = "scthtbdatosgenid", referencedColumnName = "scthtbdatosgenid")
    @ManyToOne(optional = false)
    private Scthtbdatosgen scthtbdatosgenid;
    @JoinColumn(name = "scittbescunid", referencedColumnName = "scittbescunid")
    @ManyToOne
    private Scittbescun scittbescunid;
    @JoinColumn(name = "scaltbtipoinvid", referencedColumnName = "scaltbtipoinvid")
    @ManyToOne
    private Scaltbtipoinv scaltbtipoinvid;
    @JoinColumn(name = "scaltblineinveid", referencedColumnName = "scaltblineinveid")
    @ManyToOne(optional = false)
    private Scaltblineinve scaltblineinveid;

    public Sctstbtesis() {
    }

    public Sctstbtesis(Integer sctstbtesisid) {
        this.sctstbtesisid = sctstbtesisid;
    }

    public Sctstbtesis(Integer sctstbtesisid, String titulo, String autores, Date fechagrado, String palabrasclave, String resumen, String codificacion, String nombrearchivo, Date fecharegistro, String observaciones, String summary) {
        this.sctstbtesisid = sctstbtesisid;
        this.titulo = titulo;
        this.autores = autores;
        this.fechagrado = fechagrado;
        this.palabrasclave = palabrasclave;
        this.resumen = resumen;
        this.codificacion = codificacion;
        this.nombrearchivo = nombrearchivo;
        this.fecharegistro = fecharegistro;
        this.observaciones = observaciones;
        this.summary = summary;
    }

    public Integer getSctstbtesisid() {
        return sctstbtesisid;
    }

    public void setSctstbtesisid(Integer sctstbtesisid) {
        this.sctstbtesisid = sctstbtesisid;
    }

    public String getTitulo() {
        return titulo;
    }

    public void setTitulo(String titulo) {
        this.titulo = titulo;
    }

    public String getAutores() {
        return autores;
    }

    public void setAutores(String autores) {
        this.autores = autores;
    }

    public Date getFechagrado() {
        return fechagrado;
    }

    public void setFechagrado(Date fechagrado) {
        this.fechagrado = fechagrado;
    }

    public String getPalabrasclave() {
        return palabrasclave;
    }

    public void setPalabrasclave(String palabrasclave) {
        this.palabrasclave = palabrasclave;
    }

    public String getResumen() {
        return resumen;
    }

    public void setResumen(String resumen) {
        this.resumen = resumen;
    }

    public String getCodificacion() {
        return codificacion;
    }

    public void setCodificacion(String codificacion) {
        this.codificacion = codificacion;
    }

    public String getNombrearchivo() {
        return nombrearchivo;
    }

    public void setNombrearchivo(String nombrearchivo) {
        this.nombrearchivo = nombrearchivo;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    @XmlTransient
    public Collection<Sctstbparticip> getSctstbparticipCollection() {
        return sctstbparticipCollection;
    }

    public void setSctstbparticipCollection(Collection<Sctstbparticip> sctstbparticipCollection) {
        this.sctstbparticipCollection = sctstbparticipCollection;
    }

    public Scthtbnivacade getScthtbnivacadeid() {
        return scthtbnivacadeid;
    }

    public void setScthtbnivacadeid(Scthtbnivacade scthtbnivacadeid) {
        this.scthtbnivacadeid = scthtbnivacadeid;
    }

    public Scthtbdatosgen getScthtbdatosgenid() {
        return scthtbdatosgenid;
    }

    public void setScthtbdatosgenid(Scthtbdatosgen scthtbdatosgenid) {
        this.scthtbdatosgenid = scthtbdatosgenid;
    }

    public Scittbescun getScittbescunid() {
        return scittbescunid;
    }

    public void setScittbescunid(Scittbescun scittbescunid) {
        this.scittbescunid = scittbescunid;
    }

    public Scaltbtipoinv getScaltbtipoinvid() {
        return scaltbtipoinvid;
    }

    public void setScaltbtipoinvid(Scaltbtipoinv scaltbtipoinvid) {
        this.scaltbtipoinvid = scaltbtipoinvid;
    }

    public Scaltblineinve getScaltblineinveid() {
        return scaltblineinveid;
    }

    public void setScaltblineinveid(Scaltblineinve scaltblineinveid) {
        this.scaltblineinveid = scaltblineinveid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sctstbtesisid != null ? sctstbtesisid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sctstbtesis)) {
            return false;
        }
        Sctstbtesis other = (Sctstbtesis) object;
        if ((this.sctstbtesisid == null && other.sctstbtesisid != null) || (this.sctstbtesisid != null && !this.sctstbtesisid.equals(other.sctstbtesisid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Sctstbtesis[ sctstbtesisid=" + sctstbtesisid + " ]";
    }
    
}
